<%@ page import="static javax.servlet.jsp.PageContext.SESSION_SCOPE" %>
<%--
  Created by IntelliJ IDEA.
  User: cakin
  Date: 2020/6/11
  Time: 19:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%--
  public void setAttribute (String name,
			    Object attribute,
			    int scope)
  {
    switch (scope) {
    case PAGE_SCOPE:
      mPage.put (name, attribute);
      break;
    case REQUEST_SCOPE:
      mRequest.put (name, attribute);
      break;
    case SESSION_SCOPE:
      mSession.put (name, attribute);
      break;
    case APPLICATION_SCOPE:
      mApp.put (name, attribute);
      break;
    default:
      throw new IllegalArgumentException  ("Bad scope " + scope);
    }
  }
--%>

<%
    pageContext.setAttribute("name","cakin",SESSION_SCOPE);
    // 同上面 session.setAttribute("name","cakin");
%>
</body>
</html>
